; ModuleID = 'for.c'
source_filename = "for.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: noinline nounwind uwtable
define dso_local void @f() #0 !dbg !7 {
entry:
  %x = alloca i32, align 4
  %y = alloca i32, align 4
  %z = alloca i32, align 4
  call void @llvm.dbg.declare(metadata i32* %x, metadata !10, metadata !DIExpression()), !dbg !12
  store i32 -1, i32* %x, align 4, !dbg !12
  call void @llvm.dbg.declare(metadata i32* %y, metadata !13, metadata !DIExpression()), !dbg !14
  store i32 0, i32* %y, align 4, !dbg !14
  call void @llvm.dbg.declare(metadata i32* %z, metadata !15, metadata !DIExpression()), !dbg !16
  store i32 100, i32* %z, align 4, !dbg !16
  br label %while.cond, !dbg !17

while.cond:                                       ; preds = %if.end, %entry
  %0 = load i32, i32* %y, align 4, !dbg !18
  %1 = load i32, i32* %z, align 4, !dbg !19
  %cmp = icmp slt i32 %0, %1, !dbg !20
  br i1 %cmp, label %while.body, label %while.end7, !dbg !17

while.body:                                       ; preds = %while.cond
  %2 = load i32, i32* %x, align 4, !dbg !21
  %add = add nsw i32 %2, 1, !dbg !21
  store i32 %add, i32* %x, align 4, !dbg !21
  br label %while.cond1, !dbg !23

while.cond1:                                      ; preds = %while.body3, %while.body
  %3 = load i32, i32* %x, align 4, !dbg !24
  %4 = load i32, i32* %y, align 4, !dbg !25
  %cmp2 = icmp slt i32 %3, %4, !dbg !26
  br i1 %cmp2, label %while.body3, label %while.end, !dbg !23

while.body3:                                      ; preds = %while.cond1
  %5 = load i32, i32* %x, align 4, !dbg !27
  %add4 = add nsw i32 %5, 1, !dbg !27
  store i32 %add4, i32* %x, align 4, !dbg !27
  br label %while.cond1, !dbg !23, !llvm.loop !29

while.end:                                        ; preds = %while.cond1
  %6 = load i32, i32* %x, align 4, !dbg !31
  %div = sdiv i32 %6, -1, !dbg !32
  store i32 %div, i32* %x, align 4, !dbg !33
  %7 = load i32, i32* %y, align 4, !dbg !34
  %add5 = add nsw i32 %7, 1, !dbg !35
  store i32 %add5, i32* %y, align 4, !dbg !36
  %8 = load i32, i32* %x, align 4, !dbg !37
  %cmp6 = icmp sgt i32 %8, 0, !dbg !39
  br i1 %cmp6, label %if.then, label %if.end, !dbg !40

if.then:                                          ; preds = %while.end
  %9 = load i32, i32* %x, align 4, !dbg !41
  %sub = sub nsw i32 %9, 1, !dbg !41
  store i32 %sub, i32* %x, align 4, !dbg !41
  br label %if.end, !dbg !43

if.end:                                           ; preds = %if.then, %while.end
  br label %while.cond, !dbg !17, !llvm.loop !44

while.end7:                                       ; preds = %while.cond
  ret void, !dbg !46
}

; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1

attributes #0 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone speculatable willreturn }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "for.c", directory: "/home/hzx/SPAExamples/eg0201")
!2 = !{}
!3 = !{i32 7, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{!"clang version 10.0.0 "}
!7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!8 = !DISubroutineType(types: !9)
!9 = !{null}
!10 = !DILocalVariable(name: "x", scope: !7, file: !1, line: 2, type: !11)
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !DILocation(line: 2, column: 9, scope: !7)
!13 = !DILocalVariable(name: "y", scope: !7, file: !1, line: 2, type: !11)
!14 = !DILocation(line: 2, column: 17, scope: !7)
!15 = !DILocalVariable(name: "z", scope: !7, file: !1, line: 2, type: !11)
!16 = !DILocation(line: 2, column: 24, scope: !7)
!17 = !DILocation(line: 3, column: 5, scope: !7)
!18 = !DILocation(line: 3, column: 11, scope: !7)
!19 = !DILocation(line: 3, column: 13, scope: !7)
!20 = !DILocation(line: 3, column: 12, scope: !7)
!21 = !DILocation(line: 4, column: 11, scope: !22)
!22 = distinct !DILexicalBlock(scope: !7, file: !1, line: 3, column: 15)
!23 = !DILocation(line: 5, column: 9, scope: !22)
!24 = !DILocation(line: 5, column: 16, scope: !22)
!25 = !DILocation(line: 5, column: 20, scope: !22)
!26 = !DILocation(line: 5, column: 18, scope: !22)
!27 = !DILocation(line: 6, column: 15, scope: !28)
!28 = distinct !DILexicalBlock(scope: !22, file: !1, line: 5, column: 23)
!29 = distinct !{!29, !23, !30}
!30 = !DILocation(line: 7, column: 9, scope: !22)
!31 = !DILocation(line: 8, column: 13, scope: !22)
!32 = !DILocation(line: 8, column: 15, scope: !22)
!33 = !DILocation(line: 8, column: 11, scope: !22)
!34 = !DILocation(line: 9, column: 13, scope: !22)
!35 = !DILocation(line: 9, column: 15, scope: !22)
!36 = !DILocation(line: 9, column: 11, scope: !22)
!37 = !DILocation(line: 10, column: 13, scope: !38)
!38 = distinct !DILexicalBlock(scope: !22, file: !1, line: 10, column: 13)
!39 = !DILocation(line: 10, column: 15, scope: !38)
!40 = !DILocation(line: 10, column: 13, scope: !22)
!41 = !DILocation(line: 11, column: 15, scope: !42)
!42 = distinct !DILexicalBlock(scope: !38, file: !1, line: 10, column: 20)
!43 = !DILocation(line: 12, column: 9, scope: !42)
!44 = distinct !{!44, !17, !45}
!45 = !DILocation(line: 13, column: 5, scope: !7)
!46 = !DILocation(line: 14, column: 1, scope: !7)
